package logic

import (
	"context"
	"user_srv/internal/dao"
	"user_srv/internal/svc"
	"user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type InterGRationLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewInterGRationLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InterGRationLogic {
	return &InterGRationLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 登录注册一体化
func (l *InterGRationLogic) InterGRation(in *user.InterGRationRequest) (*user.InterGRationResponse, error) {
	//调用业务逻辑
	interGRation, err := dao.InterGRation(in)
	if err != nil {
		return nil, err
	}

	return &user.InterGRationResponse{
		Id: int64(interGRation.Id),
	}, nil
}
